package com.itcast.controller;

import com.itcast.pojo.Emp;
import com.itcast.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/emps")
public class EmpController {
    @Autowired
    private EmpService empService;
    @RequestMapping("/findAll")
    public List<Emp> findAll() throws Exception {
        List<Emp> emps = empService.findAll();
        return emps;
    }
}
